﻿using OpenHttpServer.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static VIID.VIID;

namespace VIID
{
    /// <summary>
    /// 消息回调参数
    /// </summary>
    /// <param name="userIdentify">设备ID</param>
    /// <param name="command">消息类型</param>
    /// <param name="request">请求内容</param>
    public delegate HttpResponse MessageDelegate(string userIdentify,int command, HttpRequest request);

    public class VIID
    {
        public VIID()
        {

        }

        public class CallBackRequest
        {
            public Dictionary<string, string> Headers { get; set; }
            public string content { get; set; }
        }

        public class CallBackResponse
        {
            public string content { get; set; }
            public int StatusCode { get; set; } = 200;
            public Dictionary<string, string> Headers { get; set; }
        }

        #region"消息类型定义"

        public const int COMMAND_SYSTEM_REGISTER_POST = 0x0101; //注册
        public const int COMMAND_SYSTEM_UNREGISTER_POST = 0x0102; //注销
        public const int COMMAND_SYSTEM_KEEPALIVE_POST = 0x0103; //保活
        public const int COMMAND_SYSTEM_TIME_GET = 0x0104; //校时

        public const int COMMAND_VIDEOSLICES_POST = 0x0201; //上传自动采集视频片段
        public const int COMMAND_VIDEOSLICES_ID_DATA_POST = 0x0202; //上传自动采集视频片段数据
        public const int COMMAND_IMAGES_POST = 0x0203; //上传自动采集图像
        public const int COMMAND_IMAGES_ID_DATA_POST = 0x0204; //上传自动采集图像数据
        public const int COMMAND_FILES_POST = 0x0205; //上传自动采集文件
        public const int COMMAND_FILES_ID_DATA_POST = 0x0206; //上传自动采集文件数据
        public const int COMMAND_PERSONS_POST = 0x0207; //上传自动采集人员
        public const int COMMAND_FACES_POST = 0x0208; //上传自动采集人脸
        public const int COMMAND_MOTORVEHICLES_POST = 0x0209; //上传自动采集机动车
        public const int COMMAND_NONMOTORVEHICLES_POST = 0x0210; //上传自动采集非机动车
        public const int COMMAND_THINGS_POST = 0x0211; //上传自动采集物品
        public const int COMMAND_SCENES_POST = 0x0212; //上传自动采集场景
        public const int COMMAND_VIDEOLABELS_POST = 0x0213; //上传自动采集视频图像标签
        public const int COMMAND_ANALYSISRULES_POST = 0x0214; //上传视频图像分析规则

        public const int COMMAND_SUBSCRIBES_POST = 0x0301; //批量订阅
        public const int COMMAND_SUBSCRIBES_PUT = 0x0302; //批量修改订阅任务
        public const int COMMAND_SUBSCRIBES_DELETE = 0x0303; //批量删除订阅任务
        public const int COMMAND_SUBSCRIBES_ID_PUT = 0x0304; //取消订阅
        public const int COMMAND_SUBSCRIBENOTIFICATIONS_POST = 0x0305; //通知
        public const int COMMAND_SUBSCRIBENOTIFICATIONS_DELETE = 0x0306; //删除通知记录

        public const int COMMAND_DISPOSITIONS_POST = 0x0401; //批量布控
        public const int COMMAND_DISPOSITIONS_PUT = 0x0402; //批量修改布控任务
        public const int COMMAND_DISPOSITIONS_DELETE = 0x0403; //批量删除布控任务
        public const int COMMAND_DISPOSITIONS_ID_PUT = 0x0404; //撤控
        public const int COMMAND_DISPOSITIONNOTIFICATIONS_POST = 0x0405; //告警
        public const int COMMAND_DISPOSITIONNOTIFICATIONS_DELETE = 0x0406; //删除告警记录

        public const int COMMAND_APES_GET = 0x0501; //查询采集设备
        public const int COMMAND_APES_PUT = 0x0502; //更改采集设备口令
        public const int COMMAND_APSS_GET = 0x0503; //查询采集系统
        public const int COMMAND_TOLLGATES_GET = 0x0504; //查询视频卡口
        public const int COMMAND_LANES_GET = 0x0505; //查询车道

        public const int COMMAND_VIDEOSLICES_GET = 0x0601; //批量查询视频片段
        public const int COMMAND_VIDEOSLICES_ID_GET = 0x0602; //查询单个视频片段
        public const int COMMAND_VIDEOSLICES_ID_INFO_GET = 0x0603; //查询视频片段对象信息
        public const int COMMAND_VIDEOSLICES_ID_DATA_GET = 0x0604; //下载视频片段数据
        public const int COMMAND_IMAGES_GET = 0x0605; //批量查询图像
        public const int COMMAND_IMAGES_ID_GET = 0x0606; //查询单个图像
        public const int COMMAND_IMAGES_ID_INFO_GET = 0x0607; //查询图像对象信息
        public const int COMMAND_IMAGES_ID_DATA_GET = 0x0608; //下载图像数据
        public const int COMMAND_FILES_GET = 0x0609; //查询文件
        public const int COMMAND_FILES_ID_GET = 0x0610; //查询单个文件
        public const int COMMAND_FILES_ID_INFO_GET = 0x0611; //查询文件对象信息
        public const int COMMAND_FILES_ID_DATA_GET = 0x0612; //下载文件数据
        public const int COMMAND_PERSONS_GET = 0x0613; //查询人员
        public const int COMMAND_PERSONS_ID_GET = 0x0614; //查询单个人员
        public const int COMMAND_FACES_GET = 0x0615; //批量查询人脸
        public const int COMMAND_FACES_ID_GET = 0x0616; //查询单个人脸
        public const int COMMAND_MOTORVEHICLES_GET = 0x0617; //批量查询机动车
        public const int COMMAND_MOTORVEHICLES_ID_GET = 0x0618; //查询单个机动车
        public const int COMMAND_NONMOTORVEHICLES_GET = 0x0619; //批量查询非机动车
        public const int COMMAND_NONMOTORVEHICLES_ID_GET = 0x0620; //查询单个非机动车
        public const int COMMAND_THINGS_GET = 0x0621; //批量查询物品
        public const int COMMAND_THINGS_ID_GET = 0x0622; //查询单个物品
        public const int COMMAND_SCENES_GET = 0x0623; //批量查询场景
        public const int COMMAND_SCENES_ID_GET = 0x0624; //查询单个场景
        public const int COMMAND_CASES_GET = 0x0625; //批量查询视频案事件
        public const int COMMAND_CASES_ID_GET = 0x0626; //查询单个视频案事件
        public const int COMMAND_CASES_ID_INFO_GET = 0x0627; //查询视频案事件对象信息
        public const int COMMAND_DISPOSITIONS_GET = 0x0628; //查询布控任务
        public const int COMMAND_DISPOSITIONNOTIFICATIONS_GET = 0x0629; //查询告警记录
        public const int COMMAND_SUBSCRIBES_GET = 0x0630; //查询订阅任务
        public const int COMMAND_SUBSCRIBENOTIFICATIONS_GET = 0x0631; //查询通知记录
        public const int COMMAND_ANALYSISRULES_GET = 0x0632; //查询视频图像分析规则
        public const int COMMAND_VIDEOLABELS_GET = 0x0633; //查询视频图像标签

        public const int COMMAND_CASES_POST = 0x0701; //批量创建视频案事件
        public const int COMMAND_CASES_ID_PUT = 0x0702; //更新单个视频案事件
        public const int COMMAND_CASES_ID_DELETE = 0x0703; //删除单个视频案事件
        public const int COMMAND_CASES_ID_INFO_PUT = 0x0704; //更新视频案事件对象信息
        public const int COMMAND_CASES_ID_INFO_DELETE = 0x0705; //删除视频案事件对象信息
                                                                //public const int COMMAND_VIDEOSLICES_POST = 0x0706; //批量创建人工采集视频片段
        public const int COMMAND_VIDEOSLICES_ID_PUT = 0x0707; //更新人工采集单个视频片段
        public const int COMMAND_VIDEOSLICES_ID_DELETE = 0x0708; //删除人工采集单个视频片段
        public const int COMMAND_VIDEOSLICES_ID_INFO_PUT = 0x0709; //更新人工采集视频片段对象信息
        public const int COMMAND_VIDEOSLICES_ID_INFO_DELETE = 0x0710; //删除人工采集视频片段对象信息
                                                                      //public const int COMMAND_VIDEOSLICES_ID_DATA_POST = 0x0711; //创建人工采集视频片段数据
        public const int COMMAND_VIDEOSLICES_ID_DATA_DELETE = 0x0712; //删除人工采集视频片段数据
        public const int COMMAND_VIDEOIMAGES_POST = 0x0713; //批量创建人工采集图像
        public const int COMMAND_VIDEOIMAGES_ID_PUT = 0x0714; //更新人工采集单个图像
        public const int COMMAND_VIDEOIMAGES_ID_DELETE = 0x0715; //删除人工采集单个图像
        public const int COMMAND_VIDEOIMAGES_ID_INFO_PUT = 0x0716; //更新人工采集图像对象信息
        public const int COMMAND_VIDEOIMAGES_ID_INFO_DELETE = 0x0717; //删除人工采集图像对象信息
        public const int COMMAND_VIDEOIMAGES_ID_DATA_POST = 0x0718; //创建人工采集图像数据
        public const int COMMAND_VIDEOIMAGES_ID_DATA_DELETE = 0x0719; //删除人工采集图像数据
        public const int COMMAND_VIDEOFILES_POST = 0x0720; //批量创建人工采集文件
        public const int COMMAND_VIDEOFILES_ID_PUT = 0x0721; //更新人工采集单个文件
        public const int COMMAND_VIDEOFILES_ID_DELETE = 0x0722; //删除人工采集单个文件
        public const int COMMAND_VIDEOFILES_ID_INFO_PUT = 0x0723; //更新人工采集文件对象信息
        public const int COMMAND_VIDEOFILES_ID_INFO_DELETE = 0x0724; //删除人工采集文件对象信息
        public const int COMMAND_VIDEOFILES_ID_DATA_POST = 0x0725; //创建人工采集文件数据
        public const int COMMAND_VIDEOFILES_ID_DATA_DELETE = 0x0726; //删除人工采集文件数据
                                                                     //public const int COMMAND_PERSONS_POST = 0x0727; //批量创建人员
        public const int COMMAND_PERSONS_PUT = 0x0728; //批量更新人员
        public const int COMMAND_PERSONS_DELETE = 0x0729; //批量删除人员
        public const int COMMAND_PERSONS_ID_PUT = 0x0730; //更新单个人员
        public const int COMMAND_PERSONS_ID_DELETE = 0x0731; //删除单个人员
                                                             //public const int COMMAND_FACES_POST = 0x0732; //批量创建人脸
        public const int COMMAND_FACES_PUT = 0x0733; //批量更新人脸
        public const int COMMAND_FACES_DELETE = 0x0734; //批量删除人脸
        public const int COMMAND_FACES_ID_PUT = 0x0735; //更新单个人脸
        public const int COMMAND_FACES_ID_DELETE = 0x0736; //删除单个人脸
                                                           //public const int COMMAND_MOTORVEHICLES_POST = 0x0737; //批量创建机动车
        public const int COMMAND_MOTORVEHICLES_PUT = 0x0738; //批量更新机动车
        public const int COMMAND_MOTORVEHICLES_DELETE = 0x0739; //批量删除机动车
        public const int COMMAND_MOTORVEHICLES_ID_PUT = 0x0740; //更新单个机动车
        public const int COMMAND_MOTORVEHICLES_ID_DELETE = 0x0741; //删除单个机动车
                                                                   //public const int COMMAND_NONMOTORVEHICLES_POST = 0x0742; //批量创建非机动车
        public const int COMMAND_NONMOTORVEHICLES_PUT = 0x0743; //批量更新非机动车
        public const int COMMAND_NONMOTORVEHICLES_DELETE = 0x0744; //批量删除非机动车
        public const int COMMAND_NONMOTORVEHICLES_ID_POST = 0x0745; //更新单个非机动车
        public const int COMMAND_NONMOTORVEHICLES_ID_DELETE = 0x0746; //删除单个非机动车
                                                                      //public const int COMMAND_THINGS_POST = 0x0747; //批量创建物品
        public const int COMMAND_THINGS_PUT = 0x0748; //批量更新物品
        public const int COMMAND_THINGS_DELETE = 0x0749; //批量删除物品
        public const int COMMAND_THINGS_ID_PUT = 0x0750; //更新单个物品
        public const int COMMAND_THINGS_ID_DELETE = 0x0751; //删除单个物品
                                                            //public const int COMMAND_SCENES_POST = 0x0752; //批量创建场景
        public const int COMMAND_SCENES_PUT = 0x0753; //批量更新场景
        public const int COMMAND_SCENES_DELETE = 0x0754; //批量删除场景
        public const int COMMAND_SCENES_ID_PUT = 0x0755; //更新单个场景
        public const int COMMAND_SCENES_ID_DELETE = 0x0756; //删除单个场景
                                                            //public const int COMMAND_VIDEOLABELS_POST = 0x0757; //创建视频图像标签
        public const int COMMAND_VIDEOLABELS_PUT = 0x0758; //更新视频图像标签
        public const int COMMAND_VIDEOLABELS_DELETE = 0x0759; //删除视频图像标签
                                                              //public const int COMMAND_ANALYSISRULES_POST = 0x0760; //批量创建视频图像分析规则
        public const int COMMAND_ANALYSISRULES_PUT = 0x0761; //批量更新视频图像分析规则
        public const int COMMAND_ANALYSISRULES_DELETE = 0x0762; //批量删除视频图像分析规则
        #endregion
    }
}